<html>

<head>
<title>Working with Remote Files</title>
<meta name="MS-HKWD" content="Remote Files">
<meta name="MS-HKWD" content="SSH">
<style type="text/css">
.auto-style1 {
	font-family: Arial;
	font-size: 14pt;
	color: #010101;
}
.auto-style2 {
	font-family: Arial;
	font-size: 10pt;
}
</style>
</head>

<body bgcolor="#FFFCEA">

<table bgcolor="#C0C0C0" border="0" cellpadding="2" cellspacing="0" width="100%">
	<tr>
		<td align="left">
		<div align="left" class="auto-style1">
			Working with Remote Files</div>
		</td>
		<td align="right"><font face="Arial" size="2"><a href="side-by-side-file-editing.htm">
		Previous</a>&nbsp;<a href="pyscripter.htm">Top</a>&nbsp;<a href="findinfiles.htm">Next</a>
		</font></td>
	</tr>
</table>
<hr>
<div align="left">
	<font face="Arial" size="2">
	<span style="font-size: 10pt; font-family: Arial; color: #000000">Pyscripter supports 
	working with remote files i.e. files that may reside in different computers 
	(servers) including Windows and Linux machines. You can open, edit run debug 
	and save back these files.&nbsp; They work seamlessly with other PyScripter 
	features such as <a href="filemenu.htm">the Recent File list</a>, 
	<a href="theprojectexplorer.htm">project files</a>, and <a href="runconfigurations.htm">Run Configurations</a>.
	<br><br>
	<h5>Requirements</h5>
	To use PyScripter with remote files your computer need to have SSH 
	client capabilities at the computer running PyScripter and an SSH server 
	running on the remote computer.&nbsp; SSH is a widely used network protocol 
	for securely connecting to remote machines.&nbsp; Windows 10 since the April 
	2018 update includes SSH. With earlier versions of Windows 10 you need to 
	manually enable SSH through "Enable Optional Features".&nbsp; For 
	other versions of Windows you can install the latest version of
	<a href="https://github.com/PowerShell/Win32-OpenSSH">OpenSSH for Windows</a> 
	using the provided <a href="https://github.com/PowerShell/Win32-OpenSSH/wiki/Install-Win32-OpenSSH">installation 
	instructions</a>.<br><br>Alternatively on the client side you can use the 
	popular SSH client
	<a href="https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html">
	PuTTY</a>.<br><br>
	<h5>Configuring the SSH client side</h5>
	Pyscripter requires password-less authentication using rsa keys.&nbsp; You 
	need to create the rsa keys and add them to the ssh-agent service which 
	needs to be running.&nbsp; Your public key needs to be added to the 
	~/.ssh/authorised_keys file on the server side.&nbsp; Instructions are 
	provided
	<a href="https://github.com/PowerShell/Win32-OpenSSH/wiki/ssh.exe-examples">
	here</a>.</span></font></div>
<div align="left">
	<font face="Arial" size="2">
	<span style="font-size: 10pt; font-family: Arial; color: #000000"><br>
	<h5>Configuring the SSH server side<br></h5><br>The SSH server service 
	(sshd) and SSH agent service (ssh-agent) need to be running on the server 
	side.&nbsp; This is most likely true for Linux machines.&nbsp; In Windows 
	machines you need to start the server using the <br>&nbsp;&nbsp;&nbsp; net 
	start sshd<br>&nbsp;&nbsp;&nbsp; net start ssh-agent<br>commands.&nbsp;&nbsp; 
	You can also configure these services to run automatically at login time.<br><br>
	<h5>Testing the SSH connection</h5>
	From a command prompt issue the following command:<br>&nbsp;&nbsp;&nbsp; ssh
	username@hostname<br>where username 
	is the user name on the server side and host name is the IP address of the 
	SSH server.&nbsp; If this works and you see the server shell, then 
	PyScripter is ready to use the Server.<br>
	<a name="remotefiledialog" id="remotefiledialog"><h5>Opening remote files</h5></a>
	You can open remote files using the <a href="filemenu.htm">
	File Menu</a>.&nbsp; You are then shown the Open Remote File dialog shown 
	below:<br><br>
	</span></font></div>
<div align="center">
	<img alt="graphic" border="0" src="remotefiledialog.JPG" style="width:27.27em; height:10.02em"></div>
	
<div align="left" class="auto-style2"><br><br>In this dialog box you provide the 
	path to the remote file and select an SSH server from a drop-down list.&nbsp; 
	You can also setup your SSH servers by pressing the button next to the SSH 
	server field.&nbsp;&nbsp; In PyScripter remote file names are shown in the 
	UNC format \\server name\filepath.<br>
	<br>
	<h5>Setting up SSH servers</h5>
	<br>
	</div>

<div align="center">
	<img alt="graphic" border="0" src="SSHserversdialog.JPG" style="width:18.975em; height:18.60em"></div>

<div align="left" class="auto-style2"><br><br>In this dialog box you add remove 
	or modify SSH servers.&nbsp; <br>
	<br>
	</div>
<div align="left" class="auto-style2"><br><h5>Editing SSH server information</h5>
	<br>
	<br>
	</div>

<div align="center">
	<img alt="graphic" border="0" src="editsshserverdialog.JPG" style="width:37.15em; height:24.40em"></div>

<div align="left" class="auto-style2"><br><br>For each SSH server you need to 
	provide a Name that will be used to identify the SSH server, as well as the 
	user name and host name (or IP address) that will be used to connect to the 
	server.&nbsp; You also need to provide the path to the scp and ssh commads and 
	the command that will be used to execute Python on the server . Optionally you can provide additional SSH -o 
	options that will be passed to the ssh and scp commands.&nbsp; For standard 
	use leave this field empty.&nbsp; If you want to use password authentication 
	(only with Putty - see below) you also need to check the Password Needed 
	option.</div>
<div align="left" class="auto-style2"><br><br>Instead of
	<font face="Arial" size="2">
	<span style="font-size: 10pt; font-family: Arial; color: #000000">&nbsp;<a href="https://github.com/PowerShell/Win32-OpenSSH">OpenSSH for Windows</a> 
	you can use
	<a href="https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html">
	PuTTY</a>as the SSH client.&nbsp; See below a typical PuTTY configuration of 
	an SSH server.&nbsp; The example uses password authentication, but you can 
	use a private/public key combination instead for password-free 
	authentication.&nbsp;&nbsp; In that case you need to use puttygen to create 
	the private/public key and add&nbsp; -i path_to_your_private_key to the scp 
	and ssh options or instead run pagent and add to it the private key.&nbsp; 
	You also need to setup your server to accept the public key by appending it to 
	the ~/.ssh/authorized_keys file.&nbsp; See
	<a href="https://www.ssh.com/ssh/authorized_keys/openssh">here</a> for 
	details.<br></span></font></div>
<div align="center">
	<img alt="graphic" border="0" src="editsshserverdialog_putty.JPG" style="width:37.15em; height:24.40em"></div>

	
	
</body>

</html>
